package com.extension.company.common.widget;

import android.support.v4.widget.SwipeRefreshLayout;

/**
 * Created by WuXiaolong
 * github:https://github.com/WuXiaolong/PullLoadMoreRecyclerView
 */
public class SwipeRefreshLayoutOnRefresh implements SwipeRefreshLayout.OnRefreshListener {
    private PullRefreshRecyclerView pullRefreshRecyclerView;

    public SwipeRefreshLayoutOnRefresh(PullRefreshRecyclerView pullRefreshRecyclerView) {
        this.pullRefreshRecyclerView = pullRefreshRecyclerView;
    }

    @Override
    public void onRefresh() {
        if (!pullRefreshRecyclerView.isRefresh()) {
            pullRefreshRecyclerView.setIsRefresh(true);
            pullRefreshRecyclerView.refresh();
        }
    }
}
